#include "glAux.h"

Eigen::Vector3d GetPosInSpace(Eigen::Vector3d vPosViewer, float* fIM)
{
	float	vv[3];		//
	Eigen::Vector3d vResult;

	//calculate the viewer position
	vv[0] = vPosViewer.x();
	vv[1] = vPosViewer.y();
	vv[2] = vPosViewer.z();

	vResult[0] = fIM[0] * vv[0] + fIM[4] * vv[1] + fIM[8] * vv[2];
	vResult[1] = fIM[1] * vv[0] + fIM[5] * vv[1] + fIM[9] * vv[2];
	vResult[2] = fIM[2] * vv[0] + fIM[6] * vv[1] + fIM[10] * vv[2];

	return vResult;
}